Skip to content

test: add table-driven error-variant tests for all 16 TipError variants (closes #97) - #152

Open
Degentle12 wants to merge 1 commit into
StellarTips:mainfrom
Degentle12:feat/issue-97-error-table
Open

test: add table-driven error-variant tests for all 16 TipError variants (closes #97)#152
Degentle12 wants to merge 1 commit into
StellarTips:mainfrom
Degentle12:feat/issue-97-error-table

Conversation

@Degentle12

Copy link
Copy Markdown
Contributor

Summary

Closes #97 — Table-driven error-variant tests for all 16 TipError variants.

Changes

Files

  • src/test.rs: +354 lines (table + test function + panic_message helper)

Testing

cargo test test_error_variants_table_driven

Exercises 14/16 variants (2 unreachable variants gracefully skipped).

…ts (closes StellarTips#97)

Replace scattered should_panic tests with a single 16-entry table
mapping every TipError discriminant to a closure that triggers it.
A single test function iterates the table, catches panics via
catch_unwind, and verifies the expected error code is present.

Unreachable variants (StellarTips#5 TransferFailed, StellarTips#7 NoTips) are documented
and skipped with a SKIP: log.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Table-driven error-variant tests

1 participant